package com.binyouwei.designpatterns.behavior.state;

/**
 * @author 宾有为
 * Created on 2024/7/15 17:28
 * Social homepage: https://blog.csdn.net/baidu_41616022
 * @desc 状态模式 - 允许一个对象在其内部状态改变时改变它的行为。
 **/
public class StateMain {

    public static void main(String[] args) {
        StateMediaPlayer player = new StateMediaPlayer();
        player.play(); // 输出 "Already playing"
        player.setState(new StatePlayingState());
        player.play(); // 输出 "Pausing"
    }
}
